<?php 
session_start();
require_once('../includes/gen.php');
include '../includes/header-one.php';
$url = new url();
 ?>
	
	<body>
		
<?php include '../includes/header-two.php'; ?>
		
		<p><form>
		<h2>API - <a href="<?php include '../includes/config.php'; echo INSTALL_PATH; ?>api.php">api.php</a></h2>
<div class="description">You can use our API file to create a shortened URL with our service, or look up the full length URL via a simple URL request.
<h3>Examples</h3>
<div class="example">
<a href="<?php include '../includes/config.php'; echo INSTALL_PATH; ?>api.php?url=http://code.google.com/p/ksqurl"><?php include '../includes/config.php'; echo INSTALL_PATH; ?>api.php?url=http://code.google.com/p/ksqurl/downloads/list</a>
<br/><br/><a href="<?php include '../includes/config.php'; echo INSTALL_PATH; ?>api.php?short<?php include '../includes/config.php'; echo INSTALL_PATH; ?>"><?php include '../includes/install_path.php'; echo $install_path; ?>api.php?short=<?php include '../includes/install_path.php'; echo $install_path; ?>1</a><br/>
</div>
<?php 
if ( (isset($_SESSION['SESS_ID'])) && (isset($_GET['getkey'])) ) {
	echo '<br /><center>API Key: '.$url->get_apikey_from_userid($_SESSION['SESS_ID']).'</center>';
} elseif (isset($_SESSION['SESS_ID'])) { 
	echo '<br /><center><a href="?getkey">Click here to get your API key.</a></center>';
} else { 
	 echo '<br /><center>Login and then click here to get your API key.</center>';
} 
?>

</div><br/><br/>

		</form></p>

<?php include '../includes/footer.php'; ?>
